package com.javalong.affairs.module.renwujinzhang.activity.suggest.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentTransaction;

import com.javalong.affairs.R;
import com.javalong.affairs.base.activity.ToolbarActivity;
import com.javalong.affairs.base.constant.BundleKey;
import com.javalong.affairs.module.renwujinzhang.activity.suggest.fragment.SuggestListFragment;

/**
 * Created by javalong on 2016/5/22.
 */
public class SuggestListActivity extends ToolbarActivity {

    public static void toThisActivity(Context context, int id) {
        Intent intent = new Intent();
        intent.setClass(context, SuggestListActivity.class);
        intent.putExtra(BundleKey.ID, id);
        context.startActivity(intent);
    }

    @Override
    protected void initLayout() {
        setContentView(R.layout.activity_fragment);
    }


    @Override
    protected void initData() {
        loadOneFragment();
    }

    private void loadOneFragment() {
        FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
        SuggestListFragment listFragment = new SuggestListFragment();
        Bundle bundle = new Bundle();
        bundle.putInt(BundleKey.ID, getIntent().getIntExtra(BundleKey.ID, 0));
        listFragment.setArguments(bundle);
        ft.add(R.id.fl_content, listFragment);
        ft.commit();
    }
}
